<template>
  <view class="personal-info">
    <v-title :title="title" :desc="desc" :info="info">
      <view class="block-shadow">
        <block v-for="(item,index) in personalInfo" :key="index">
          <cmd-cell-item :title="item.title" slot-right>
            <input  type="digit" @input="inputVal" @blur="judgeVal(item)"  placeholder="请输入成绩" class="userinput" v-model="item.gradevalue">
          </cmd-cell-item>
        </block>
      </view>
    </v-title>
    <view class="btn-row">
      <button type="primary" class="primary saveBtn" @click="save" v-if="showBtn">保存</button>
    </view>
  </view>
</template>

<script>
    import vTitle from '@/components/common/title/index';
    import cmdCellItem from '@/components/cmd-cell-item/cmd-cell-item'
    import mInput from '@/components/common/m-input/m-input'
    import cjMixins from './cjMixins';
    import MineService from '@/services/mine/index';
    const mineService = new MineService();
    export default {
        name: "galkcj",
        mixins:[cjMixins],
        components:{
            vTitle,
            cmdCellItem,
            mInput
        },
        data(){
            return{
                title:'公安联考成绩',
                desc:'',
                info:'',
                personalInfo:[
                    // {
                    //     title:'*行测',
                    //     info: true,
                    //     uservalue:''
                    // },
                    // {
                    //     title:'*申论',
                    //     info: true,
                    //     uservalue:''
                    // },
                    // {
                    //     title:'*公安专业科目',
                    //     info: true,
                    //     uservalue:''
                    // }
                ],
                showBtn:false
            }
        },
         onLoad({code=''}){
          console.log('code:',code)
          this.code = code;
          const $this = this;
          mineService.getUserGradleResult({code}).then(
            resultDto=>{
              const {success,result} = resultDto;
              if(success){
                  // $this.title = result.title;
                  // $this.desc = result.desc;
                  // $this.info = result.info;
                  $this.personalInfo = result.personalInfo;
                  $this.showBtn = true;
              }
            }
          )
        },
        methods:{
            
        }
    }
</script>

<style scoped>
  .userinput {
    font-size: 26upx;
    text-align: right;
  }
  .btn-row {
    margin-top: 50upx;
    padding: 20upx 50upx;
  }
</style>